EstablishConnection Method (Remote Data)

       

Establishes a physical connection to an ODBC server.

Syntax

object.EstablishConnection prompt, readonly, options

The EstablishConnection method syntax has these parts:

Part Description
object An object expression that evaluates to an rdoConnection object.
prompt Optional. Integer value indicating ODBC prompting characteristic (see the OpenConnection method on the rdoEnvironment object).
readonly Optional. Boolean value which is True if intending to use connection as read-only.
options Optional. Integer value indicating connection options. This parameter has the same rules, restrictions and possible values that it does in the OpenConnection method of the rdoEnvironment object.

Remarks

This method causes the rdoConnection object to physically connect to the server, if it is not so already. This method is used when creating stand-alone rdoConnection objects or when re-connecting rdoConnection objects that have been disconnected using the Close method.

Unlike the OpenConnection method, the EstablishConnection method does not automatically append the rdoConnection object to the rdoConnections collection. If you want to add the newly established connection into the rdoConnections collection, you must use the Add method. You can use the Remove method to remove a member from the rdoConnections collection.

When using the Client Batch cursor library, the EstablishConnection method can be used to establish a connection once the ActiveConnection of an rdoResultset or rdoQuery object has been set to Nothing.

Just as with the OpenConnection method, the prompt argument dictates how the ODBC driver manager prompts the user for missing arguments needed to establish the connection. You can also request that the connection be made asynchronously by using the rdAsyncEnable option.

In general, you must set the Connect property and other appropriate properties of the rdoConnection object prior to making an attempt at connecting to a remote server.

See the OpenConnection method for details on how the rdoConnection properties should be set prior to attempting to use the EstablishConnection method.